package com.tensquare.qa.service;

import com.tensquare.qa.dao.PlDao;
import com.tensquare.qa.pojo.Pl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class PlService {
    @Autowired
    private PlDao plDao;

    //查询所有
    public List<Pl> findAll() {
        return plDao.findAll();
    }

    //添加
    @Transactional
    public void save(Pl pl) {
        plDao.save(pl);
    }

    //根据问题id查询标签
    public List<Pl> findByPid(String pid) {
        return plDao.findByProblemid(pid);
    }
}
